{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">
                        <div class="layui-input-inline layui-form">
                            <select name="information_type" id="assn_type" lay-search="" class="layui-input">
                                <option value="">不限类型</option>
                                {volist name="info"  id="vo"}
                                <option value="{$vo['video_type_id']}">{$vo['video_type_name']}</option>
                                {/volist}
                            </select>
                        </div>

                        <div class="layui-input-inline layui-form">
                            <select name="video_status" id="assn_is_first" lay-search="" class="layui-input">
                                <option value="">不限</option>
                                <option value="1">待审核</option>
                                <option value="2">审核通过</option>
                                <option value="3">审核不通过</option>
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="keyword" class="layui-input search" name="keyword"
                                   placeholder="标题"/>
                        </div>

                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button class="layui-btn layui-btn-normal" id="empty" lay-submit="" lay-filter="LAY-search">
                                重置
                            </button>
                        </div>
                    </div>
                </div>
                <!--搜索框开始-->
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="testReload"></table>

                    <!--图片模板-->
                    <script type="text/html" id="imgTpl">
                        <img src="{{d.information_thumb}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"/>
                    </script>

                    <!--状态显示模板-->
                    <!--<script type="text/html" id="statBar">-->
                    <!--{{# if(d.assn_type == 1){ }}-->
                    <!--军事类社团-->
                    <!--{{# } }}-->
                    <!--{{# if(d.assn_type == 2){ }}-->
                    <!--非军事类社团-->
                    <!--{{# } }}-->
                    <!--</script>-->

                    <script type="text/html" id="video_status">
                    {{# if(d.video_status == 1){ }}
                    待审核
                    {{# } }}
                    {{# if(d.video_status == 2){ }}
                    审核通过
                    {{# } }}
                    {{# if(d.video_status == 3){ }}
                    审核不通过
                    {{# } }}
                    </script>
                    <script type="text/html" id="viTpl">
                        <div style="width: 260px;height: 200px">
                            <video controls="controls" >
                                <source src="{{d.video_url}}" type="video/mp4" />
                            </video>
                        </div>
                    </script>
                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        <a href="javascript:;" onclick="wk.href('{:url('edit')}?id={{d.video_id}}')" class="btn btn-primary btn-xs m-r-xs" title="编辑">编辑</a>
                        {{# if(d.video_status == 1){ }}
                        <a href="javascript:;" onclick="wk.confirm('{{d.video_id}}','{:url('adopt')}','确认通过?')" class="btn  btn-primary btn-xs m-r-xs" title="通过">通过</a>
                        <a href="javascript:;" onclick="wk.confirm('{{d.video_id}}','{:url('reject')}','确认驳回吗?')" class="btn  btn-danger btn-xs m-r-xs" title="驳回">驳回</a>
                        {{# } }}

                        <a href="javascript:;" onclick="wk.confirm('{{d.video_id}}','{:url('del')}','确认删除?')" class="btn  btn-danger btn-xs m-r-xs" title="删除">删除</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("video/index")}'
            , response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
//                {type: 'checkbox', fixed: 'left',}
                {type: 'numbers', width: 400, title: '序号'},
                {type: 'numbers', width: 80, title: '序号'}
                , {field: 'video_id', width: '', title: '视频ID', align: 'center'}
                , {field: 'video_title', width: '', title: '视频名称', align: 'center'}
                , {field: 'video_url', width: 260, title: '视频', align: 'center', templet:'#viTpl'}
                , {field: 'user_username', width: 180, title: '用户名称', align: 'center'}
                , {field: 'video_time', width: 180, title: '发布时间', align: 'center'}
                , {field: 'video_type_name', width: '', title: '视频标签', align: 'center'}
                , {field: 'num', width: '', title: '评论数', align: 'center'}
                , {field: 'video_status', width:200, title: '状态', align: 'center', templet: '#video_status'}
                , {field: 'videourl', width:200, title: '外链', align: 'center'}
                , {fixed: 'left', width: 400, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            , done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });



    });
</script>
</body>
</html>